# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-flipflop
pkgname=('python2-flipflop' 'python-flipflop')
_pkgname=flipflop
pkgver=1.0
pkgrel=11
pkgdesc='A python FastCGI wrapper for WSGI applications.'
arch=('any')
url='https://github.com/Kozea/flipflop'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cff8e6e0ecfbf633aacbfe7612837cc85d5208b1dadc4b30a20cc4934549365a066df9ed66bab4e760b7fe73d7ce796de6a53fc01cec742d81fceb17e2529267')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flipflop() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-flipflop() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

